#ifndef JOYSTICK_H_INCLUDED
#define JOYSTICK_H_INCLUDED

#include <SDL/SDL.h>
#ifndef WIN32
#include <linux/input.h>
#endif
#include <math.h>

#include "src/utils/settings.h"

// #include <linux/input.h>
// #include <sys/stat.h>
// #include <sys/ioctl.h>
#include <fcntl.h>
// #include <unistd.h>


#define VENDOR 0x046d
#define G25NORMAL 0xc294
#define G25EXTENDED 0xc299

class Joystick
{
        public:
                Joystick( );
                ~Joystick();
                
                void applyForce( float forwardWheelOrientation );

        private:
                Settings* settings;

		int G25send_command(char command[7]);

		int ff_fd;
#ifndef WIN32
                ff_effect effect;
                ff_effect effect2;

                input_event play;

		struct usb_dev_handle {
			int fd;

			struct usb_bus *bus;
			struct usb_device *device;

			int config;
			int interface;
			int altsetting;

			/* Added by RMT so implementations can store other per-open-device data */
			void *impl_info;
		};
		
// 		struct usb_bus *busses;
// 		struct usb_bus *bus;
// 		struct usb_device *dev;
// 		usb_dev_handle *usb_handle;
// 		struct usb_device*  usb_find_device(uint16_t vendor,uint16_t product);
#endif

};

#endif